package bandi.osgi.dal.dao.abstr;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public abstract class AbstractDAO {
	private final String userName = "root";

    private final String password = "password";

    private final String connectionString = "jdbc:mysql://localhost/DB_TRACKING_SERVICE";

    /**
     * Creates a Connection to a MySQL DBMS.
     * 
     * @return {@link Connection}
     * @throws ClassNotFoundException
     * @throws SQLException
     */
    protected Connection createConnection() throws ClassNotFoundException, SQLException {
        Class.forName("com.mysql.jdbc.Driver");
        final Connection myConnection = DriverManager.getConnection(connectionString, userName, password);
        return myConnection;
    }
}
